<?php

global $global_config, $site_mods, $db, $module_name,$global_array_cat;
$xtpl = new XTemplate("global.thongbao.tpl", NV_ROOTDIR . "/themes/" . $block_theme . "/blocks");
$sql = "SELECT id, listcatid, publtime, exptime, title, alias, homeimgthumb FROM `" . NV_PREFIXLANG . "_news_rows` WHERE `status`= 1 AND `publtime` < " . NV_CURRENTTIME . " AND (`exptime`=0 OR `exptime`>" . NV_CURRENTTIME . ") AND `is_notice`=1 ORDER BY `publtime` DESC LIMIT 0 , 10";
$result = $db->sql_query($sql);

$rows = array();
while (list( $id, $listcatid, $publtime, $exptime, $title, $alias, $homeimgthumb ) = $db->sql_fetchrow($result)) {
    $catid = end( explode( ",", $listcatid ) );
    $link = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" .
            NV_NAME_VARIABLE . "=news&amp;" .
            NV_OP_VARIABLE . "=" . $global_array_cat[$catid]['alias'] . "/" . $alias . "-" . $id;
    $row['id'] = $id;
    $row['link'] = $link;
    $row['title'] = $title;
    $xtpl->assign("CONTENT", $row);
    $xtpl->parse("main.items");
    
}
$xtpl->parse("main");
$content = $xtpl->text("main");
?>